/**
 * Software License, Version 1.0
 * 
 * Copyright 2003 The Trustees of Indiana University.  All rights reserved.
 * 
 *
 *Redistribution and use in source and binary forms, with or without 
 *modification, are permitted provided that the following conditions are met:
 *
 *1) All redistributions of source code must retain the above copyright notice,
 * the list of authors in the original source code, this list of conditions and
 * the disclaimer listed in this license;
 *2) All redistributions in binary form must reproduce the above copyright 
 * notice, this list of conditions and the disclaimer listed in this license in
 * the documentation and/or other materials provided with the distribution;
 *3) Any documentation included with all redistributions must include the 
 * following acknowledgement:
 *
 *"This product includes software developed by the Community Grids Lab. For 
 * further information contact the Community Grids Lab at 
 * http://communitygrids.iu.edu/."
 *
 * Alternatively, this acknowledgement may appear in the software itself, and 
 * wherever such third-party acknowledgments normally appear.
 * 
 *4) The name Indiana University or Community Grids Lab or NaradaBrokering, 
 * shall not be used to endorse or promote products derived from this software 
 * without prior written permission from Indiana University.  For written 
 * permission, please contact the Advanced Research and Technology Institute 
 * ("ARTI") at 351 West 10th Street, Indianapolis, Indiana 46202.
 *5) Products derived from this software may not be called NaradaBrokering, 
 * nor may Indiana University or Community Grids Lab or NaradaBrokering appear
 * in their name, without prior written permission of ARTI.
 * 
 *
 * Indiana University provides no reassurances that the source code provided 
 * does not infringe the patent or any other intellectual property rights of 
 * any other entity.  Indiana University disclaims any liability to any 
 * recipient for claims brought by any other entity based on infringement of 
 * intellectual property rights or otherwise.  
 *
 *LICENSEE UNDERSTANDS THAT SOFTWARE IS PROVIDED "AS IS" FOR WHICH NO 
 *WARRANTIES AS TO CAPABILITIES OR ACCURACY ARE MADE. INDIANA UNIVERSITY GIVES
 *NO WARRANTIES AND MAKES NO REPRESENTATION THAT SOFTWARE IS FREE OF 
 *INFRINGEMENT OF THIRD PARTY PATENT, COPYRIGHT, OR OTHER PROPRIETARY RIGHTS. 
 *INDIANA UNIVERSITY MAKES NO WARRANTIES THAT SOFTWARE IS FREE FROM "BUGS", 
 *"VIRUSES", "TROJAN HORSES", "TRAP DOORS", "WORMS", OR OTHER HARMFUL CODE.  
 *LICENSEE ASSUMES THE ENTIRE RISK AS TO THE PERFORMANCE OF SOFTWARE AND/OR 
 *ASSOCIATED MATERIALS, AND TO THE PERFORMANCE AND VALIDITY OF INFORMATION 
 *GENERATED USING SOFTWARE.
 */
/*
 * An XML document type.
 * Localname: Subscribe
 * Namespace: http://schemas.xmlsoap.org/ws/2004/08/eventing
 * Java type: cgl.narada.wsinfra.schemas.eventing.SubscribeDocument
 *
 * Automatically generated - do not modify.
 */
package cgl.narada.wsinfra.schemas.eventing.impl;
/**
 * A document containing one Subscribe(@http://schemas.xmlsoap.org/ws/2004/08/eventing) element.
 *
 * This is a complex type.
 */
public class SubscribeDocumentImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements cgl.narada.wsinfra.schemas.eventing.SubscribeDocument
{
    
    public SubscribeDocumentImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName SUBSCRIBE$0 = 
        new javax.xml.namespace.QName("http://schemas.xmlsoap.org/ws/2004/08/eventing", "Subscribe");
    
    
    /**
     * Gets the "Subscribe" element
     */
    public cgl.narada.wsinfra.schemas.eventing.SubscribeDocument.Subscribe getSubscribe()
    {
        synchronized (monitor())
        {
            check_orphaned();
            cgl.narada.wsinfra.schemas.eventing.SubscribeDocument.Subscribe target = null;
            target = (cgl.narada.wsinfra.schemas.eventing.SubscribeDocument.Subscribe)get_store().find_element_user(SUBSCRIBE$0, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * Sets the "Subscribe" element
     */
    public void setSubscribe(cgl.narada.wsinfra.schemas.eventing.SubscribeDocument.Subscribe subscribe)
    {
        synchronized (monitor())
        {
            check_orphaned();
            cgl.narada.wsinfra.schemas.eventing.SubscribeDocument.Subscribe target = null;
            target = (cgl.narada.wsinfra.schemas.eventing.SubscribeDocument.Subscribe)get_store().find_element_user(SUBSCRIBE$0, 0);
            if (target == null)
            {
                target = (cgl.narada.wsinfra.schemas.eventing.SubscribeDocument.Subscribe)get_store().add_element_user(SUBSCRIBE$0);
            }
            target.set(subscribe);
        }
    }
    
    /**
     * Appends and returns a new empty "Subscribe" element
     */
    public cgl.narada.wsinfra.schemas.eventing.SubscribeDocument.Subscribe addNewSubscribe()
    {
        synchronized (monitor())
        {
            check_orphaned();
            cgl.narada.wsinfra.schemas.eventing.SubscribeDocument.Subscribe target = null;
            target = (cgl.narada.wsinfra.schemas.eventing.SubscribeDocument.Subscribe)get_store().add_element_user(SUBSCRIBE$0);
            return target;
        }
    }
    /**
     * An XML Subscribe(@http://schemas.xmlsoap.org/ws/2004/08/eventing).
     *
     * This is a complex type.
     */
    public static class SubscribeImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements cgl.narada.wsinfra.schemas.eventing.SubscribeDocument.Subscribe
    {
        
        public SubscribeImpl(org.apache.xmlbeans.SchemaType sType)
        {
            super(sType);
        }
        
        private static final javax.xml.namespace.QName ENDTO$0 = 
            new javax.xml.namespace.QName("http://schemas.xmlsoap.org/ws/2004/08/eventing", "EndTo");
        private static final javax.xml.namespace.QName DELIVERY$2 = 
            new javax.xml.namespace.QName("http://schemas.xmlsoap.org/ws/2004/08/eventing", "Delivery");
        private static final javax.xml.namespace.QName EXPIRES$4 = 
            new javax.xml.namespace.QName("http://schemas.xmlsoap.org/ws/2004/08/eventing", "Expires");
        private static final javax.xml.namespace.QName FILTER$6 = 
            new javax.xml.namespace.QName("http://schemas.xmlsoap.org/ws/2004/08/eventing", "Filter");
        
        
        /**
         * Gets the "EndTo" element
         */
        public cgl.narada.wsinfra.schemas.addressing.EndpointReferenceType getEndTo()
        {
            synchronized (monitor())
            {
                check_orphaned();
                cgl.narada.wsinfra.schemas.addressing.EndpointReferenceType target = null;
                target = (cgl.narada.wsinfra.schemas.addressing.EndpointReferenceType)get_store().find_element_user(ENDTO$0, 0);
                if (target == null)
                {
                    return null;
                }
                return target;
            }
        }
        
        /**
         * True if has "EndTo" element
         */
        public boolean isSetEndTo()
        {
            synchronized (monitor())
            {
                check_orphaned();
                return get_store().count_elements(ENDTO$0) != 0;
            }
        }
        
        /**
         * Sets the "EndTo" element
         */
        public void setEndTo(cgl.narada.wsinfra.schemas.addressing.EndpointReferenceType endTo)
        {
            synchronized (monitor())
            {
                check_orphaned();
                cgl.narada.wsinfra.schemas.addressing.EndpointReferenceType target = null;
                target = (cgl.narada.wsinfra.schemas.addressing.EndpointReferenceType)get_store().find_element_user(ENDTO$0, 0);
                if (target == null)
                {
                    target = (cgl.narada.wsinfra.schemas.addressing.EndpointReferenceType)get_store().add_element_user(ENDTO$0);
                }
                target.set(endTo);
            }
        }
        
        /**
         * Appends and returns a new empty "EndTo" element
         */
        public cgl.narada.wsinfra.schemas.addressing.EndpointReferenceType addNewEndTo()
        {
            synchronized (monitor())
            {
                check_orphaned();
                cgl.narada.wsinfra.schemas.addressing.EndpointReferenceType target = null;
                target = (cgl.narada.wsinfra.schemas.addressing.EndpointReferenceType)get_store().add_element_user(ENDTO$0);
                return target;
            }
        }
        
        /**
         * Unsets the "EndTo" element
         */
        public void unsetEndTo()
        {
            synchronized (monitor())
            {
                check_orphaned();
                get_store().remove_element(ENDTO$0, 0);
            }
        }
        
        /**
         * Gets the "Delivery" element
         */
        public cgl.narada.wsinfra.schemas.eventing.DeliveryType getDelivery()
        {
            synchronized (monitor())
            {
                check_orphaned();
                cgl.narada.wsinfra.schemas.eventing.DeliveryType target = null;
                target = (cgl.narada.wsinfra.schemas.eventing.DeliveryType)get_store().find_element_user(DELIVERY$2, 0);
                if (target == null)
                {
                    return null;
                }
                return target;
            }
        }
        
        /**
         * Sets the "Delivery" element
         */
        public void setDelivery(cgl.narada.wsinfra.schemas.eventing.DeliveryType delivery)
        {
            synchronized (monitor())
            {
                check_orphaned();
                cgl.narada.wsinfra.schemas.eventing.DeliveryType target = null;
                target = (cgl.narada.wsinfra.schemas.eventing.DeliveryType)get_store().find_element_user(DELIVERY$2, 0);
                if (target == null)
                {
                    target = (cgl.narada.wsinfra.schemas.eventing.DeliveryType)get_store().add_element_user(DELIVERY$2);
                }
                target.set(delivery);
            }
        }
        
        /**
         * Appends and returns a new empty "Delivery" element
         */
        public cgl.narada.wsinfra.schemas.eventing.DeliveryType addNewDelivery()
        {
            synchronized (monitor())
            {
                check_orphaned();
                cgl.narada.wsinfra.schemas.eventing.DeliveryType target = null;
                target = (cgl.narada.wsinfra.schemas.eventing.DeliveryType)get_store().add_element_user(DELIVERY$2);
                return target;
            }
        }
        
        /**
         * Gets the "Expires" element
         */
        public java.lang.Object getExpires()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.SimpleValue target = null;
                target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(EXPIRES$4, 0);
                if (target == null)
                {
                    return null;
                }
                return target.getObjectValue();
            }
        }
        
        /**
         * Gets (as xml) the "Expires" element
         */
        public cgl.narada.wsinfra.schemas.eventing.ExpirationType xgetExpires()
        {
            synchronized (monitor())
            {
                check_orphaned();
                cgl.narada.wsinfra.schemas.eventing.ExpirationType target = null;
                target = (cgl.narada.wsinfra.schemas.eventing.ExpirationType)get_store().find_element_user(EXPIRES$4, 0);
                return target;
            }
        }
        
        /**
         * True if has "Expires" element
         */
        public boolean isSetExpires()
        {
            synchronized (monitor())
            {
                check_orphaned();
                return get_store().count_elements(EXPIRES$4) != 0;
            }
        }
        
        /**
         * Sets the "Expires" element
         */
        public void setExpires(java.lang.Object expires)
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.SimpleValue target = null;
                target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(EXPIRES$4, 0);
                if (target == null)
                {
                    target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(EXPIRES$4);
                }
                target.setObjectValue(expires);
            }
        }
        
        /**
         * Sets (as xml) the "Expires" element
         */
        public void xsetExpires(cgl.narada.wsinfra.schemas.eventing.ExpirationType expires)
        {
            synchronized (monitor())
            {
                check_orphaned();
                cgl.narada.wsinfra.schemas.eventing.ExpirationType target = null;
                target = (cgl.narada.wsinfra.schemas.eventing.ExpirationType)get_store().find_element_user(EXPIRES$4, 0);
                if (target == null)
                {
                    target = (cgl.narada.wsinfra.schemas.eventing.ExpirationType)get_store().add_element_user(EXPIRES$4);
                }
                target.set(expires);
            }
        }
        
        /**
         * Unsets the "Expires" element
         */
        public void unsetExpires()
        {
            synchronized (monitor())
            {
                check_orphaned();
                get_store().remove_element(EXPIRES$4, 0);
            }
        }
        
        /**
         * Gets the "Filter" element
         */
        public cgl.narada.wsinfra.schemas.eventing.FilterType getFilter()
        {
            synchronized (monitor())
            {
                check_orphaned();
                cgl.narada.wsinfra.schemas.eventing.FilterType target = null;
                target = (cgl.narada.wsinfra.schemas.eventing.FilterType)get_store().find_element_user(FILTER$6, 0);
                if (target == null)
                {
                    return null;
                }
                return target;
            }
        }
        
        /**
         * True if has "Filter" element
         */
        public boolean isSetFilter()
        {
            synchronized (monitor())
            {
                check_orphaned();
                return get_store().count_elements(FILTER$6) != 0;
            }
        }
        
        /**
         * Sets the "Filter" element
         */
        public void setFilter(cgl.narada.wsinfra.schemas.eventing.FilterType filter)
        {
            synchronized (monitor())
            {
                check_orphaned();
                cgl.narada.wsinfra.schemas.eventing.FilterType target = null;
                target = (cgl.narada.wsinfra.schemas.eventing.FilterType)get_store().find_element_user(FILTER$6, 0);
                if (target == null)
                {
                    target = (cgl.narada.wsinfra.schemas.eventing.FilterType)get_store().add_element_user(FILTER$6);
                }
                target.set(filter);
            }
        }
        
        /**
         * Appends and returns a new empty "Filter" element
         */
        public cgl.narada.wsinfra.schemas.eventing.FilterType addNewFilter()
        {
            synchronized (monitor())
            {
                check_orphaned();
                cgl.narada.wsinfra.schemas.eventing.FilterType target = null;
                target = (cgl.narada.wsinfra.schemas.eventing.FilterType)get_store().add_element_user(FILTER$6);
                return target;
            }
        }
        
        /**
         * Unsets the "Filter" element
         */
        public void unsetFilter()
        {
            synchronized (monitor())
            {
                check_orphaned();
                get_store().remove_element(FILTER$6, 0);
            }
        }
    }
}
